package com.michael.retail.sys.biz.controller.v1;

import com.michael.retail.commons.pojo.global.R;
import com.michael.retail.sys.api.pojo.entity.OAuth2Client;
import com.michael.retail.sys.biz.service.OAuth2ClientService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类功能描述:
 * <pre>
 *   xxxx
 * </pre>
 *
 * @author Michael
 * @version 1.0
 * @date 2021/7/5 19:55
 */
@SuppressWarnings("AlibabaClassNamingShouldBeCamel")
@Slf4j
@RestController
@RequestMapping("/api/v1/oauth-clients")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OAuth2ClientController {

    private final OAuth2ClientService oAuth2ClientService;

    @ApiOperation(value = "客户端详情")
    @ApiImplicitParam(name = "clientId", value = "客户端id", required = true, paramType = "path", dataType = "String")
    @GetMapping("/{clientId}")
    public R detail(@PathVariable String clientId) {
        OAuth2Client client = oAuth2ClientService.getById(clientId);
        return R.succeed(client);
    }
}
